<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
    <!-- 非套餐目录 -->
    <div th:if="${courseType} !='PACKAGE'" class="cm-task-chapter">
        <th:block th:if="!${#lists.isEmpty(courseCatalogList)}" th:each="catalog : ${courseCatalogList}">
            <dl th:if="${catalog['nodeType']}==1" class="cm-task-chpter-item">
                <dt class="tchpter-item-parent txtOf">
                    <aside th:if="!${#lists.isEmpty(catalog['childCourseCatalogList'])}" class="pull-right">
                        <span class="c-ccc fs14"><i class="fa fa-chevron-up"></i></span>
                    </aside>
                    <aside th:if="${#lists.isEmpty(catalog['childCourseCatalogList'])} and ${catalog['materialId']} > 0" class="pull-right">
                        <span th:if="!${#maps.isEmpty(catalog['coursePlayRecord'])} and ${catalog['coursePlayRecord']['finish']}==1" class="c-999 fs14" data-toggle="tooltip" data-placement="top" data-original-title="最近学习">
                            <i class="fa fa-adjust c-info"></i>
                        </span>
                        <span th:if="!${#maps.isEmpty(catalog['coursePlayRecord'])} and ${catalog['coursePlayRecord']['finish']}==2" class="c-999 fs14" data-toggle="tooltip" data-placement="top" data-original-title="最近学习">
                            <i class="fa fa-circle c-info"></i>
                        </span>
                        <span th:if="${#maps.isEmpty(catalog['coursePlayRecord'])}" class="c-ccc"><i class="fa fa-circle-o"></i></span>
                    </aside>
                    <a th:if="!${#lists.isEmpty(catalog['childCourseCatalogList'])}" href="javascript:void(0);">
                        <span class="fs18 mr5 c-info"><i class="fa fa-navicon"></i></span>
                        <span class="fs16 c-333" th:text="${catalog['catalogName']}"></span>
                    </a>
                    <a th:if="${#lists.isEmpty(catalog['childCourseCatalogList'])}" href="javascript:void(0);" class="txtOf play-catalog-box" th:attrappend="data-course-id=${catalog['courseId']},data-id=${catalog['id']}">
                        <span class="fs18 mr5 c-info"><i class="fa fa-navicon"></i></span>
                        <span class="fs16 c-333" th:text="${catalog['catalogName']}"></span>
                    </a>
                </dt>
                <dd th:if="!${#lists.isEmpty(catalog['childCourseCatalogList'])}" class="tchpter-item-children">
                    <ol>
                        <li th:each="subCatalog : ${catalog['childCourseCatalogList']}">
                            <aside class="pull-right">
                                <span class="hand c-ccc fs14 mr5" th:if="!${#strings.isEmpty(subCatalog['lessonStartTime'])} and ${subCatalog['materialTypeKey']}=='LIVE'" th:text="${#strings.substring(subCatalog['lessonStartTime'],0,16)}+'--'+${#strings.substring(subCatalog['lessonEndTime'],0,16)}"></span>
                                <span th:if="!${#maps.isEmpty(subCatalog['coursePlayRecord'])} and ${subCatalog['coursePlayRecord']['finish']}==1" class="c-999 fs14" data-toggle="tooltip" data-placement="top" data-original-title="最近学习">
                                    <i class="fa fa-adjust c-info"></i>
                                </span>
                                <span th:if="!${#maps.isEmpty(subCatalog['coursePlayRecord'])} and ${subCatalog['coursePlayRecord']['finish']}==2" class="c-999 fs14" data-toggle="tooltip" data-placement="top" data-original-title="最近学习">
                                    <i class="fa fa-circle c-info"></i>
                                </span>
                                <span th:if="${#maps.isEmpty(subCatalog['coursePlayRecord'])}" class="c-ccc">
                                    <i class="fa fa-circle-o"></i>
                                </span>
                            </aside>
                            <a href="javascript:void(0);" th:classappend="${catalog['lessonTime']==null&&catalog['materialId']!=0} ? 'play-catalog-box' : ''" class="txtOf" th:attrappend="data-course-id=${subCatalog['courseId']},data-id=${subCatalog['id']}">
                                <i class="fa fa-circle fs12 mr5 vam c-ccc"></i>
                                <samp th:text="${catalog['lessonTime']!=null&&catalog['materialId']==0?catalog['catalogName']+'课程暂未上线预计上线时间'+catalog['lessonTime']:catalog['catalogName']}"></samp>
                                <span th:if="${subCatalog['audition']}==2" class="badge unFw badge-primary ml5 fs12" data-toggle="tooltip" data-placement="top" data-original-title="免费试听此节">试听</span>
                            </a>
                        </li>
                    </ol>
                </dd>
            </dl>
            <dl th:if="${catalog['nodeType']}==2" class="cm-task-chpter-item">
                <dd class="tchpter-item-children" style="margin-left:0px;">
                    <ol>
                        <li>
                            <aside class="pull-right">
                                <span class="hand c-ccc fs14 mr5" th:if="${catalog['materialTypeKey']}=='LIVE'" th:text="${#strings.substring(catalog['lessonStartTime'],0,16)}+'--'+${#strings.substring(catalog['lessonEndTime'],0,16)}"></span>
                                <span th:if="!${#maps.isEmpty(catalog['coursePlayRecord'])} and ${catalog['coursePlayRecord']['finish']}==1" class="c-999 fs14" data-toggle="tooltip" data-placement="top" data-original-title="最近学习">
                                    <i class="fa fa-adjust c-info"></i>
                                </span>
                                <span th:if="!${#maps.isEmpty(catalog['coursePlayRecord'])} and ${catalog['coursePlayRecord']['finish']}==2" class="c-999 fs14" data-toggle="tooltip" data-placement="top" data-original-title="最近学习">
                                    <i class="fa fa-circle c-info"></i>
                                </span>
                                <span th:if="${#maps.isEmpty(catalog['coursePlayRecord'])}" class="c-ccc">
                                    <i class="fa fa-circle-o"></i>
                                </span>
                            </aside>
                            <a href="javascript:void(0);" th:classappend="${catalog['lessonTime']==null&&catalog['materialId']!=0} ? 'play-catalog-box' : ''" class="txtOf " th:attrappend="data-course-id=${catalog['courseId']},data-id=${catalog['id']}">
                                <i class="fa fa-circle fs12 mr5 vam c-ccc"></i>
                                <samp th:text="${catalog['lessonTime']!=null&&catalog['materialId']==0?catalog['catalogName']+'课程暂未上线预计上线时间'+catalog['lessonTime']:catalog['catalogName']}"></samp>
                                <span th:if="${catalog['audition']}==2" class="badge unFw badge-primary ml5 fs12" data-toggle="tooltip" data-placement="top" data-original-title="免费试听此节">试听</span>
                            </a>
                        </li>
                    </ol>
                </dd>
            </dl>
        </th:block>
        <section th:if="${#lists.isEmpty(courseCatalogList)} and ${courseType} !='PACKAGE'" class="no-data__wrap">
            <span class="no-data-ico"></span>
            <p class="mt20"><span class="c-666">课程还没有设置目录~~</span></p>
        </section>
    </div>
    <!-- 如果是套餐 -->
    <div th:if="!${#maps.isEmpty(packageCourseMap)} and ${courseType}=='PACKAGE'" th:with="pointer= ${#lists.isEmpty(packageCourseMap[2])}? 1 : ${#lists.size(packageCourseMap[2])}" class="ml20">
        <section class="packCourMenu__wrap">
            <!-- 阶段套餐课程 -->
            <div th:if="!${#lists.isEmpty(packageCourseMap[2])}" th:each="packages,index : ${packageCourseMap[2]}">
                <section class="packCourTitle hLh30 pr">
                    <span class="fs18 c-333" th:text="${packages['stageContext']}"></span>
                    <span class="ml10 c-999" th:if="!${#lists.isEmpty(packages.childList)}" th:text="${#lists.size(packages.childList)}+'门课程'"></span>
                    <span class="ml10 c-999" th:if="${#lists.isEmpty(packages.childList)}">0门课程</span>
                    <aside class="packCourNum">
                        <button class="btn btn-info btn-circle btn-outline fs16" type="button" th:text="${index['index']}+1"></button>
                    </aside>
                </section>
                <section class="mt20 pt10">
                    <div class="course-list__wrap packCour-sm__wrap">
                        <div class="row">
                            <div th:if="!${#lists.isEmpty(packages.childList)}" th:each="subCourse : ${packages['childList']}" class="col-sm-4 pr">
                                <div th:attrappend="data-course=${subCourse['courseId']}" class="thumbnail course-list-item">
                                    <a  th:if="!${buyCourse}  and !(${subCourse['course']['courseTypeKey']}=='LIVE')" th:href="@{/web/course/courseInfo?courseId={courseId}(courseId=${subCourse['courseId']})}">
                                        <img class="lazy" width="100%" th:attrappend="data-original=${#maps.isEmpty(subCourse['course']['imageMap'])}?'':${subCourse['course']['imageMap']['pcUrlMap']['medium']}"/>
                                    </a>
                                    <a  th:if="!${buyCourse}  and ${subCourse['course']['courseTypeKey']}=='LIVE'" th:href="@{/web/course/liveInfo?courseId={courseId}(courseId=${subCourse['courseId']})}">
                                        <img class="lazy" width="100%" th:attrappend="data-original=${#maps.isEmpty(subCourse['course']['imageMap'])}?'':${subCourse['course']['imageMap']['pcUrlMap']['medium']}"/>
                                    </a>
                                    <a  th:if="${buyCourse}" th:href="@{/web/uc/play/toPlayCourse?catalogId=0&type=PERSON&packageId={packageId}&courseId={courseId}(courseId=${subCourse['courseId']},packageId=${courseIdParent})}">
                                        <img class="lazy" width="100%" th:attrappend="data-original=${#maps.isEmpty(subCourse['course']['imageMap'])}?'':${subCourse['course']['imageMap']['pcUrlMap']['medium']}"/>
                                    </a>
                                    <div class="caption">
                                        <section class="cm-desc-txt__twoLine">
                                            <a  th:if="!${buyCourse}  and !(${subCourse['course']['courseTypeKey']}=='LIVE')" th:href="@{/web/course/courseInfo?courseId={courseId}(courseId=${subCourse['courseId']})}" class="fs14 c-333" th:text="${subCourse['course']['courseName']}"></a>
                                            <a  th:if="!${buyCourse}  and ${subCourse['course']['courseTypeKey']}=='LIVE'" th:href="@{/web/course/liveInfo?courseId={courseId}(courseId=${subCourse['courseId']})}" class="fs14 c-333" th:text="${subCourse['course']['courseName']}"></a>
                                            <a  th:if="${buyCourse}" th:href="@{/web/uc/play/toPlayCourse?catalogId=0&type=PERSON&packageId={packageId}&courseId={courseId}(courseId=${subCourse['courseId']},packageId=${courseIdParent})}" class="fs14 c-333" th:text="${subCourse['course']['courseName']}"></a>
                                        </section>
                                        <section class="mt10 clearfix">
                                            <aside class="pull-right">
                                                <span th:if="${subCourse['course']['courseTypeKey']}=='COLUMNS'" class="label label-warning label-inline fs12 vam mr5">专栏</span>
                                                <span th:if="${subCourse['course']['courseTypeKey']}=='LIVE'" class="label label-success label-inline fs12 vam mr5">直播</span>
                                                <span th:if="${subCourse['course']['courseTypeKey']}=='VIDEO'" class="label label-info label-inline fs12 vam mr5">视频</span>
                                            </aside>
                                            <aside class="pull-left">
                                                <span class="fs12 c-999" th:if="!${#strings.isEmpty(subCourse['course']['containNodeType'])}" th:text="${#strings.replace(subCourse['course']['containNodeType'],'、','/')}"></span>
                                                <span class="fs12 c-999" th:if="${#strings.isEmpty(subCourse['course']['containNodeType'])}"> 课程未设置章节</span>
                                            </aside>
                                        </section>
                                    </div>
                                </div>
                                <aside class="pc-addIco"><i class="fa fa-plus c-999 fs24"></i></aside>
                            </div>
                        </div>
                    </div>
                </section>
            </div>
            <section th:if="!${#lists.isEmpty(packageCourseMap[1])}" class="packCourTitle hLh30 pr">
                <span class="fs18 c-333">非阶段课程</span>
                <aside class="packCourNum">
                    <button class="btn btn-info btn-circle btn-outline fs16" type="button" th:text="${#lists.isEmpty(packageCourseMap[2])}? 1: ${#lists.size(packageCourseMap[2])}+1">0</button>
                </aside>
            </section>
            <section th:if="!${#lists.isEmpty(packageCourseMap[1])}" class="mt20 pt10">
                <div class="course-list__wrap packCour-sm__wrap">
                    <div class="row">
                        <div th:if="${packages['courseId']} > 0" th:each="packages : ${packageCourseMap[1]}" class="col-sm-4 pr">
                            <div th:attrappend="data-course=${packages['courseId']}" class="thumbnail course-list-item">
                                <a th:if="!${buyCourse}  and !(${packages['course']['courseTypeKey']}=='LIVE')"  th:href="@{/web/course/courseInfo?courseId={courseId}(courseId=${packages['courseId']})}">
                                    <img class="lazy" width="100%" th:attrappend="data-original=${#maps.isEmpty(packages['course']['imageMap'])}?'':${packages['course']['imageMap']['pcUrlMap']['medium']}"/>
                                </a>
                                <a th:if="!${buyCourse}  and ${packages['course']['courseTypeKey']}=='LIVE'"  th:href="@{/web/course/liveInfo?courseId={courseId}(courseId=${packages['courseId']})}">
                                    <img class="lazy" width="100%" th:attrappend="data-original=${#maps.isEmpty(packages['course']['imageMap'])}?'':${packages['course']['imageMap']['pcUrlMap']['medium']}"/>
                                </a>
                                <a th:if="${buyCourse}" th:href="@{/web/uc/play/toPlayCourse?catalogId=0&type=PERSON&packageId={packageId}&courseId={courseId}(courseId=${packages['courseId']},packageId=${courseIdParent})}">
                                    <img class="lazy" width="100%" th:attrappend="data-original=${#maps.isEmpty(packages['course']['imageMap'])}?'':${packages['course']['imageMap']['pcUrlMap']['medium']}"/>
                                </a>

                                <div class="caption">
                                    <section class="cm-desc-txt__twoLine">
                                        <a th:if="!${buyCourse}  and !(${packages['course']['courseTypeKey']}=='LIVE')" th:href="@{/web/course/courseInfo?courseId={courseId}(courseId=${packages['courseId']})}" class="fs14 c-333" th:text="${packages['course']['courseName']}"></a>
                                        <a th:if="!${buyCourse}  and ${packages['course']['courseTypeKey']}=='LIVE' " th:href="@{/web/course/liveInfo?courseId={courseId}(courseId=${packages['courseId']})}" class="fs14 c-333" th:text="${packages['course']['courseName']}"></a>
                                        <a th:if="${buyCourse}" th:href="@{/web/uc/play/toPlayCourse?catalogId=0&type=PERSON&packageId={packageId}&courseId={courseId}(courseId=${packages['courseId']},packageId=${courseIdParent})}" class="fs14 c-333" th:text="${packages['course']['courseName']}"></a>

                                    </section>
                                    <section class="mt10 clearfix">
                                        <aside class="pull-right">
                                            <span th:if="${packages['course']['courseTypeKey']}=='COLUMNS'" class="label label-warning label-inline fs12 vam mr5">专栏</span>
                                            <span th:if="${packages['course']['courseTypeKey']}=='LIVE'" class="label label-success label-inline fs12 vam mr5">直播</span>
                                            <span th:if="${packages['course']['courseTypeKey']}=='VIDEO'" class="label label-info label-inline fs12 vam mr5">视频</span>
                                        </aside>
                                        <aside class="pull-left">
                                            <span class="fs12 c-999" th:if="!${#strings.isEmpty(packages['course']['containNodeType'])}" th:text="${packages['course']['containNodeType']}"></span>
                                            <span class="fs12 c-999" th:if="${#strings.isEmpty(packages['course']['containNodeType'])}"> 课程未设置章节</span>
                                        </aside>
                                    </section>
                                </div>
                            </div>
                            <aside class="pc-addIco"><i class="fa fa-plus c-999 fs24"></i></aside>
                        </div>
                    </div>
                </div>
            </section>
        </section>
    </div>
    <section th:if="${#maps.isEmpty(packageCourseMap)} and ${courseType}=='PACKAGE'" class="no-data__wrap">
        <span class="no-data-ico"></span>
        <p class="mt20"><span class="c-666">套餐还没有设置课程~~</span></p>
    </section>
    <script type="text/javascript">
        var buyCourse = $('#buyCourse').val();
        if(buyCourse == 'true'){
            $('span.badge-primary').remove();
        }
    </script>
</html>
